//
//  BHApplyDetailInfoCell.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/6/18.
//

import UIKit

class BHApplyDetailInfoCell: UITableViewCell {
   
    
    @IBOutlet var keyLabArray: [UILabel]!
    
    @IBOutlet var valueArray: [UILabel]!
    
    @IBOutlet weak var cover_backView: UIView!
    

    var model: BHGameApplyUserModel! {
        didSet {
            
            for (index,key_label) in self.keyLabArray.enumerated() {
                let value_label = self.valueArray[index]
                key_label.isHidden = true
                value_label.isHidden = true
            }
            
            for (index,objc) in model.allCustomDic.enumerated() {
                if index < self.keyLabArray.count {
                    let label = self.keyLabArray[index]
                    let value_label = self.valueArray[index]
                    
                    label.isHidden = false
                    value_label.isHidden = false
                    
                    label.text = objc.key
                    value_label.text = "\(objc.value)"
                }
            }
        }
    }
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.cover_backView.addLayerCorner(4, 0, .white)
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        
    }
    
    static func infoHeight(count: Int) -> CGFloat {
        if count == 0 {
            return 0
        }
        else if count == 1 {
            return 65
        }else if count == 2 {
            return 95
        }else {
            return 132
        }
    }
}
